
const { ccclass, property } = cc._decorator;

@ccclass
export default class Camera extends cc.Component {

    @property(cc.Node)
    hero: cc.Node = null;

    update(dt: number) {

        let wVec2 = this.hero.convertToWorldSpaceAR<cc.Vec3>(cc.v3(0, 0, 0));

        let lVec2 = this.node.parent.convertToNodeSpaceAR<cc.Vec3>(wVec2);

        this.node.position = lVec2;

        //TODO 移动到地图尽头，摄像机应该停止移动

    }
}

